<template>
    <div>
      用户名：<input type="text" v-model="username"><br>
      密码：<input type="password" v-model="password"><br>
      地址：<input type="text" v-model="addr"><br>
      身份证号：<input type="text" v-model="number"><br>
      真实姓名：<input type="text" v-model="name"><br>
      <button @click="register">注册</button>
    </div>
</template>

<script>
export default {
    name: "register",
    data(){
        return{
            username: '',
            password: '',
            addr: '',
            number: '',
            name: ''
        }
    },
    methods:{
        register(){
            var data = new FormData()
            data.append('username', this.username)
            data.append('password', this.password)
            data.append('addr', this.addr)
            data.append('number', this.number)
            data.append('name', this.name)
            this.$axios.post('user/' ,data).then(resp=>{
              console.log(resp.data.msg)
            })
        }
    }
}
</script>

<style scoped>

</style>
